<?php
/**
* @author Bimal Poudel
* @copyright since 2006, Bimal Poudel
* @package Smarty Framework
* @support http://www.odesk.com/users/~~dd91d11caed0cdce
* @contact http://www.sanjaal.com
* @company Sanjaal Corps
*/

# Created on: 2012-04-08 12:50:53 506

/**
* Sorts users by changing the sinking weight.
* Extended fetures can sort teh data within the set of record (categories) only.
*/

$user_id = $variable->get('id', 'integer', 0);
$code = $variable->get('code', 'string', ''); # For future references

# Find out the direction to sort. Go upwards or downloads in the list.
$direction = strtolower($variable->get('direction', 'string', 'down'));
$direction = (in_array($direction, array('up', 'down')))?$direction:'down';

# Match active records (and  optionally other condistions)
$sorter = new sorter("AND `is_active`='Y'");
$sorter->sort_table('pokes_users', 'user_id', $user_id, $direction, 'sink_weight');

$messenger = new messenger('warning', 'The record has been sorted.');

# This is a controller only page and does not have anything to display.
headers::back('users-list.php');
#stopper::url(url::last_page('users-list.php'));
?>